package com.stack.auto_parts.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.stack.auto_parts.entity.User;
import org.apache.ibatis.annotations.Delete;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

/**
 * @Title: UserMapper
 * @Author WUYU_MIN
 * @Package com.stack.auto_parts.mapper
 * @Date 2024/7/8 14:19
 * @description: User类的mapper
 */

@Mapper
public interface UserMapper extends BaseMapper<User>{

//    @Select("select * from user where user_name = #{userNmae} and password = #{password}")


    @Delete("delete from user where id = #{id}")
    public Integer delete(Integer id);

    @Select("select * from user where id = #{id}")
    public User seltet(Integer id);

    /*@Insert("insert into user(uuid,user_name,phone,email,role,image) values(#{uuid},#{userName},#{phone},#{email},#{role},#{image})")
    public int insert(User user);*/

    public List<User> listBycondition(String user_name, String phone, String role);

    @Select("select * from user where phone = #{phone} and password = #{password}")
    User getByUserNameAndPassword(String phone, String password);
}
